import 'dart:async';
import 'package:qr_code_app/common/service/app_data.dart';
import 'package:qr_code_app/module/user/entity/user_entity.dart';
import 'package:todo_flutter/todo_flutter.dart';

part 'user_event.dart';

part 'user_state.dart';

class UserBloc extends BaseBloc<UserEvent, UserState> {
  static UserBloc get instance => _getInstance();
  static UserBloc? _instance;

  UserBloc() : super(UserInitState(AppData.getUser())) {
    _init();
  }

  DataChangeBloc<int> unreadCountBloc = DataChangeBloc(0);
  int u = 0;

  static UserBloc _getInstance() {
    _instance ??= UserBloc();
    return _instance!;
  }

  void _init() {}

  ///获取用户信息
  void getUserInfo() {
    // add(GetUserInfoEvent());
  }

  ///修改昵称
  void changeName(String name) {
    // add(ChangeNameEvent(name));
  }

  ///修改生日
  void changeBirthday(String year, String month, String day) {
    // add(ChangeBirthdayEvent(year, month, day));
  }

  void logout() {
    // add(LogoutEvent());
  }
}
